home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
- set -e
- . /usr/share/debconf/confmodule
-
- SANED_DEFAULT=/etc/default/saned
-
- saned_eh () {
- echo "saned couldn't start; check your inetd configuration and README.Debian"
- }
-
- if [ "$1" = "configure" ] || [ "$1" = "reconfigure" ]; then
- db_get sane-utils/saned_run
- RUN_SANED="$RET"
-
- # Add saned service, disabled by default
- if [ -x /usr/sbin/update-inetd ]; then
- update-inetd --add "#<off># sane-port\tstream\ttcp\tnowait\tsaned:saned\t/usr/sbin/saned saned"
- fi
-
- # Stop debconf; output to stdout after this point. update-inetd needs debconf.
- db_stop
-
- # Create saned user/group if they do not exist
- if ! getent passwd | grep -q "^saned:"; then
- echo "Adding saned group and user..."
- adduser --quiet --system --no-create-home --group saned || true
- fi
-
- if id saned | grep -q "groups=.*\(scanner\)"; then
- deluser --quiet saned scanner
- fi
-
- if [ -e $SANED_DEFAULT ]; then
- if [ "$RUN_SANED" = "true" ]; then
- RUN_SANED=yes
- else
- RUN_SANED=no
- fi
-
- sed -e "s/^ *RUN=.*/RUN=$RUN_SANED/" < $SANED_DEFAULT > $SANED_DEFAULT.tmp
- mv -f $SANED_DEFAULT.tmp $SANED_DEFAULT
- fi
-
- if dpkg --compare-versions "$2" lt "1.0.19-23ubuntu4"; then
- update-rc.d -f saned remove
- fi
- fi
-
-
- # Automatically added by dh_installinit
- if [ -x "/etc/init.d/saned" ]; then
- update-rc.d saned start 50 2 3 4 5 . stop 20 1 . >/dev/null
- if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
- invoke-rc.d saned start || saned_eh
- else
- /etc/init.d/saned start || saned_eh
- fi
- fi
- # End automatically added section
-
-
-